home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / freebsd / readme.bsd < prev    next >
Text File  |  1994-07-11  |  8KB  |  210 lines

  1.  
  2. ------------------------------------------------------------------------
  3.                       [incr Tcl] - version 1.5
  4. ------------------------------------------------------------------------
  5.   This version will only work with Tcl version 7.0 and beyond.
  6.   At this point, it has only been tested with versions 7.0-7.3.
  7.  
  8.   Please send comments or suggestions to michael.mclennan@att.com.
  9. ========================================================================
  10.               Copyright (c) 1993   AT&T Bell Laboratories
  11. ========================================================================
  12. Permission to use, copy, modify, and distribute this software and its
  13. documentation for any purpose and without fee is hereby granted,
  14. provided that the above copyright notice appear in all copies and that
  15. both that the copyright notice and warranty disclaimer appear in
  16. supporting documentation, and that the names of AT&T Bell Laboratories
  17. any of their entities not be used in advertising or publicity
  18. pertaining to distribution of the software without specific, written
  19. prior permission.
  20.  
  21. AT&T disclaims all warranties with regard to this software, including
  22. all implied warranties of merchantability and fitness.  In no event
  23. shall AT&T be liable for any special, indirect or consequential
  24. damages or any damages whatsoever resulting from loss of use, data or
  25. profits, whether in an action of contract, negligence or other
  26. tortuous action, arising out of or in connection with the use or
  27. performance of this software.
  28. ========================================================================
  29.  
  30.  
  31. Implementation Notes:
  32.  
  33. [incr Tcl] adds object-oriented programming facilities to Tcl.  It
  34. was NOT designed as yet another whiz-bang object-oriented programming
  35. language; indeed, it is patterned somewhat after C++.  It was designed
  36. to support more structured programming in Tcl.  Scripts that grow
  37. beyond a few thousand lines become extremely difficult to maintain.
  38. [incr Tcl] attacks this problem in the same way that any object-
  39. oriented programming language would, by providing mechanisms for
  40. data encapsulation behind well-defined interfaces.  In many cases,
  41. ideas for new widgets or objects can be prototyped using [incr Tcl],
  42. and if necessary, the code can be translated to C for more efficient
  43. execution; the public (Tcl) interface, however, could remain unchanged.
  44.  
  45.  
  46. READ THE INTRO:
  47.  
  48. A tutorial explanation of [incr Tcl] is presented in the PostScipt
  49. file "Intro.ps".  This tutorial describes a family of "Toaster"
  50. classes that illustrate many of the features available in this package.
  51. Source code for the example classes is provided in "demos/toasters".
  52.  
  53.  
  54. INSTALLATION AND TESTING:
  55.  
  56.   1)  Obtain this distribution from harbor.ecn.purdue.edu:
  57.  
  58.         ftp harbor.ecn.purdue.edu
  59.         cd pub/tcl/extensions
  60.         binary
  61.         get itcl-1.5.tar.gz
  62.         quit
  63.  
  64.   2)  Uncompress and untar the distribution:
  65.  
  66.         uncompress itcl-1.5.tar.Z
  67.         tar xvf itcl-1.5.tar
  68.  
  69.   3)  Run the configuration script:
  70.  
  71.         cd itcl-1.5
  72.         ./configure
  73.  
  74.       or, for systems that don't recognize "#!" in shell scripts:
  75.  
  76.         cd itcl-1.5
  77.         /bin/sh ./configure
  78.  
  79.       By default, the configuration script will set things up
  80.       to be installed in "/usr/local".  You can change this by
  81.       specifying a different "prefix" in the "configure" command:
  82.  
  83.         ./configure --prefix=/your/install/path
  84.  
  85.       You may be queried for the location of Tcl/Tk include files
  86.       and libraries.  Note that this package also requires the
  87.       path to the Tcl source code, since it requires "tclInt.h"
  88.       and this file is not usually installed with the standard
  89.       include files.
  90.  
  91.       The "configure" script generates new Makefiles from their
  92.       respective templates (Makefile.in).
  93.  
  94.       If "configure" can't find something, you can make changes
  95.       to the intermediate "config.status" script, and invoke this
  96.       script to reconfigure the Makefiles:
  97.  
  98.         vi config.status
  99.         ./config.status
  100.  
  101.       As a last resort, you can edit the Makefiles in "src/",
  102.       "man/" and "library/" by hand and insert the proper paths.
  103.  
  104.   4)  Build the libraries and the executables:
  105.  
  106.         make all
  107.  
  108.   5)  Test by running the demos:
  109.  
  110.         cd demos
  111.         ../src/itcl_wish -f coloredit
  112.         ../src/itcl_wish -f listboxes
  113.  
  114.   6)  Install the libraries (libitcl.a and libitcl.so.1.5) and the
  115.       executables (itcl_sh and itcl_wish), along with the man page
  116.       and library scripts onto your system:
  117.  
  118.         make install
  119.  
  120.  
  121. ADDING [incr Tcl] TO YOUR OWN APPLICATION:
  122.  
  123.   To add [incr Tcl] facilities to a Tcl application, modify the
  124.   Tcl_AppInit() routine as follows:
  125.  
  126.   1) Include the "itcl.h" header file near the top of the file
  127.      containing Tcl_AppInit():
  128.  
  129.        #include "itcl.h"
  130.  
  131.   2) Within the body of Tcl_AppInit(), add the following lines:
  132.  
  133.        if (Itcl_Init(interp) == TCL_ERROR) {
  134.            return TCL_ERROR;
  135.        }
  136.  
  137.   3) Link your application with libitcl.a
  138.  
  139.   NOTE:  Example files "tclAppInit.c" and "tkAppInit.c" containing
  140.          the changes shown above above are included in this
  141.          distribution.
  142.  
  143.  
  144. DEMO CLASSES:
  145.  
  146. Example classes in the "demos/widgets" directory illustrate how
  147. [incr Tcl] can be used to create new widgets that look (from a
  148. programming standpoint) like normal widgets but are written entirely
  149. in Tcl.  These widgets are defined as object classes, and pack
  150. primitive widgets together to provide higher-level functionality.
  151.  
  152. Two demos are provided which illustrate how these "mega-widgets"
  153. could be used in a real application:
  154.  
  155.     demos/listboxes .... Illustrates high-level listboxes:
  156.                            - ListBox
  157.                            - SelectBox
  158.                            - FilteredBox
  159.  
  160.     demos/coloredit .... Allows colors to be changed in another
  161.                          Tk application.  Illustrates:
  162.                            - FilteredBox
  163.                            - ColorEditor
  164.  
  165. Once you have created and installed the "itcl_wish" application which
  166. recognizes [incr Tcl] facilities, you can invoke these demos as:
  167.  
  168.     % cd demos
  169.     % itcl_wish -f listboxes
  170.     % itcl_wish -f coloredit
  171.  
  172. It is necessary to sit in the "demos" directory when running these
  173. scripts, since they need to access the class definition files that
  174. reside in the "widgets" directory below.
  175.  
  176.  
  177. LIBRARY ROUTINES:
  178.  
  179. The "library" directory contains a few useful Tcl procedures:
  180.  
  181.     library/itcl_mkindex.tcl .... the usual "auto_mkindex" proc
  182.                                   updated to include [incr Tcl]
  183.                                   classes when building an index
  184.  
  185.     library/itcl_reload.tcl ..... a series of procedures for
  186.                                   unloading and reloading class
  187.                                   definitions; useful when debugging
  188.                                   [incr Tcl] applications.
  189.  
  190.  
  191. SUMMARY:
  192.  
  193. Widgets provide a natural domain for object-oriented programming
  194. techniques.  They are not, however, the only domain.  I believe that
  195. [incr Tcl] can be used in more diverse applications to add structure
  196. to Tcl programs.  The "itcl_class" mechanism should be used to group
  197. related procedures and their shared data into a neat little package
  198. with a well-defined interface.
  199.  
  200. Please experiment with this facility and send me your comments.
  201.  
  202. --Michael
  203.  
  204.     =--===   ///////////////////////////////////////////////////////////
  205.   =-----====   Michael J. McLennan 2C-226    michael.mclennan@att.com 
  206.  =------=====  AT&T Bell Laboratories
  207.  ==----======  1247 S Cedar Crest Blvd        Phone: (610) 712-2842
  208.   ==========   Allentown, PA  18103             FAX: (610) 712-3843
  209.     ======   ///////////////////////////////////////////////////////////
  210.